#ifndef _EVENT_HANDLER_H_
#define _EVENT_HANDLER_H_

#include <stdio.h>
#include "setting_structs.h"
#include "comm_interface.h"
#include "commands.h"
#include "status.h"
#include "lpc17xx.h"

//! The interval between each time we poll the PTT inputs, this is in 10us, so 10 = 10*10 us
#define EVENT_HANDLER_POLL_PTT_STATUS_INTERVAL  10

//! Bit which shows PTT input via the Footswitch
#define STATUS_PTT_INPUT_FOOTSWITCH    0
//! Bit which shows PTT input via the Winkey ports RTS
#define STATUS_PTT_INPUT_WK_RTS        1
//! Bit which shows PTT input via the Winkey ports DTR
#define STATUS_PTT_INPUT_WK_DTR        2
//! Bit which shows PTT input via the FSK/CW port RTS
#define STATUS_PTT_INPUT_FSKCW_RTS     3
//! Bit which shows PTT input via VOX sense input
#define STATUS_PTT_INPUT_VOX_SENSE     4

#define EVENT_HANDLER_CHECK_PTT_INPUTS 0

typedef struct {
  uint32_t temp_ptt_input;
  uint8_t curr_ptt_input;
  uint8_t prev_ptt_input;
  uint8_t flags;
} struct_event_status;

void event_handler_execute(void);

void event_handler_10us_tick(void);
void event_handler_1ms_tick(void);


#endif
